﻿<UserControl x:Class="MyCompany.Views.LogView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:UserInterfaceLibrary="clr-namespace:MyCompany.UserInterfaceLibrary;assembly=MyCompany.UserInterfaceLibrary"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBox x:Name="textBoxLog"
                 Margin="10,10,10,0"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Stretch"
                 HorizontalScrollBarVisibility="Auto"
                 IsReadOnly="True"
                 Text="{Binding Log,
                                Mode=OneWay}"
                 TextWrapping="Wrap"
                 VerticalScrollBarVisibility="Auto" />
        <StackPanel Grid.Row="1"
                    Margin="10"
                    Orientation="Horizontal">
            <UserInterfaceLibrary:NarrowButton Padding="10,5,10,5">
                Copy to clipboard
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_CopyToClipboard" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton Margin="10,0,0,0" Padding="10,5,10,5">
                OK
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_OKRequested" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
        </StackPanel>
    </Grid>
</UserControl>